home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / fortran / fv121s.zip / FAT4.DOC < prev    next >
Text File  |  1988-06-08  |  16KB  |  449 lines

  1.  
  2.         MAY 1988                FAT-VIDEO 1.21  CLRSTR          Page V-55
  3.  
  4.  
  5.  
  6.         CLRSTR(STRING,LEN)
  7.  
  8.           Clear a string by filling with blanks, the space character.
  9.  
  10.         character*132 string1
  11.         character*1   string2(132)
  12.         integer*2     len
  13.  
  14.         len=132
  15.         call clrstr(string1,len)
  16.         call clrstr(string2,len)
  17.  
  18.         inputs:  string,len
  19.         returns: string
  20.  
  21.         Description:
  22.  
  23.           This function fills each byte in the string with the space
  24.         character, up to the length specified.
  25.  
  26.  
  27.  
  28.  
  29.         REMNUL(STRING)
  30.  
  31.           This routine remove the null character( char(0)) an the
  32.        '`' character, and replaces them with a space character.
  33.  
  34.         character*20 string
  35.         call remnul(string)
  36.  
  37.         Description:
  38.  
  39.           This function is used to remove the null character in null
  40.         terminated strings, to allow Fortran functions to use the string
  41.         data.
  42.  
  43.  
  44.         MAY 1988                FAT-VIDEO 1.21  CGETS           Page V-56
  45.  
  46.  
  47.  
  48.         CGETS(STRING,MAXLEN,IERR)
  49.  
  50.           Get a string from the keyboard, echo it to the screen, and return
  51.         its length and error status. The returned string is null terminated.
  52.  
  53.         integer*2 maxlen,ierr
  54.         character string*40
  55.  
  56.         maxlen=40
  57.         call cgets(string,maxlen,ierr)
  58.         if(ierr.eq.-1)return
  59.  
  60.         Description:
  61.  
  62.           This routine gets an ascii string from the user. It can be no
  63.         longer than maxlen, and the actual length typed is returned in
  64.         maxlen. Ierr is returned as zero if all went well. If the user
  65.         types the ESC key during string input the string is cleared and
  66.         the function returns ierr=-1 . This allows a clean cancel
  67.         of the read function. The string characters are echoed as they
  68.         are typed, but with normal video attributes. This function uses
  69.         the BIOS keyboard functions, and cannot be interrupted by the
  70.         Ctrl-C or Ctrl-Break keypresses. This function clears the string
  71.         prior to accepting any input.
  72.  
  73.         INPUTS:
  74.         Maxlen = Maximum number of characters to accept from user.
  75.  
  76.         OUTPUTS:
  77.         STRING = String typed in by the user.
  78.         Maxlen = Actual number of characters typed by the user.
  79.         Ierr   = 0 safe return, -1 the ESC key was pressed.
  80.  
  81.  
  82.  
  83.         Copyright (c) 1987,1988    Marc A Norton   All Rights Reserved.
  84.  
  85.  
  86.         MAY 1988                FAT-VIDEO 1.21  CGETAS           Page V-58
  87.  
  88.         CGETAS(ATTR,STRING,MAXLEN,IERR)
  89.  
  90.           Get a string from the keyboard, echo it to the screen using the
  91.         attribute specified, and return its length and error status. The
  92.         returned string is null terminated.
  93.  
  94.         integer*2 attr,maxlen,ierr
  95.         character string*40
  96.  
  97.         maxlen=40
  98.         call cgetas(attr,string,maxlen,ierr)
  99.         if(ierr.eq.-1)return
  100.  
  101.         Description:
  102.  
  103.           This routine gets an ascii string from the user. It can be no
  104.         longer than maxlen, and the actual length typed is returned in
  105.         maxlen. Ierr is returned as zero if all went well. If the user
  106.         types the ESC key during string input the string is cleared and
  107.         the function returns ierr=-1 . This allows a clean cancel
  108.         of the read function. The string characters are echoed as they
  109.         are typed, but with the video attribute given. This function uses
  110.         the BIOS keyboard functions, and cannot be interrupted by the
  111.         Ctrl-C or Ctrl-Break keypresses. This function clears the string
  112.         prior to accepting any input.
  113.  
  114.         INPUTS:
  115.         ATTR   = Attribute to use in echoing the string to the screen.
  116.         Maxlen = Maximum number of characters to accept from user.
  117.  
  118.         OUTPUTS:
  119.         STRING = String typed in by the user.
  120.         Maxlen = Actual number of characters typed by the user.
  121.         Ierr   = 0 safe return, -1 the ESC key was pressed.
  122.  
  123.  
  124.  
  125.         Copyright (c) 1987,1988    Marc A Norton   All Rights Reserved.
  126.  
  127.  
  128.         MAY 1988                FAT-VIDEO 1.21  CGETIS           Page V-58
  129.  
  130.  
  131.  
  132.         CGETIS(ATTR,STRING,MAXLEN,IERR)
  133.  
  134.           Get a string from the keyboard, echo it to the screen, and return
  135.         its length and error status. This routine only accepts integers and
  136.         the - sign.
  137.  
  138.         integer*2 attr,maxlen,ierr
  139.         character string*20
  140.  
  141.         maxlen=20
  142.         call cgetis(attr,string,maxlen,ierr)
  143.         if(ierr.eq.-1)return
  144.  
  145.         Description:
  146.  
  147.           This routine gets an integer string from the user. It can be no
  148.         longer than maxlen, and the actual length typed is returned in
  149.         maxlen. Ierr is returned as zero if all went well. If the user
  150.         types the ESC key during string input the string is cleared and
  151.         the function returns ierr=-1 . This allows a clean cancel
  152.         of the read function. The string characters are echoed as they
  153.         are typed, but with normal video attributes. This function uses
  154.         the BIOS keyboard functions, and cannot be interrupted by the
  155.         Ctrl-C or Ctrl-Break keypresses. Only integers and the - sign
  156.         are accepted by this routine. This routine clears the string prior
  157.         to accepting any input.
  158.           The returned string is not null terminated and may be read into
  159.         an integer variable as follows:
  160.  
  161.         real*8    R1
  162.         integer*2 I1
  163.         character*20 string
  164.  
  165.         maxlen=20
  166.         call cput(' Enter a number: `')
  167.         call cgetis(attr,string,maxlen,ierr)
  168.         if(ierr.eq.-1)return
  169.         Read(unit=string,fmt='(g20.0)')R1
  170.         I1 = R1
  171.  
  172.         INPUTS:
  173.         ATTR   = Attribute to use in echoing the string to the screen.
  174.         Maxlen = Maximum number of characters to accept from user.
  175.  
  176.         OUTPUTS:
  177.         STRING = String typed in by the user.
  178.         Maxlen = Actual number of characters typed by the user.
  179.         Ierr   = 0 safe return, -1 the ESC key was pressed.
  180.  
  181.         Copyright (c) 1987,1988    Marc A Norton   All Rights Reserved.
  182.  
  183.  
  184.         MAY 1988                FAT-VIDEO 1.21  CGETRS           Page V-59
  185.  
  186.  
  187.  
  188.  
  189.         CGETRS(ATTR,STRING,MAXLEN,IERR)
  190.  
  191.           Get a string from the keyboard, echo it to the screen, and return
  192.         its length and error status. This routine only accepts integers and
  193.         the -,+ signs, and D,d,E,e characters. It is intended to accept
  194.         floating point numbers.
  195.  
  196.         integer*2 attr,maxlen,ierr
  197.         character string*20
  198.  
  199.         maxlen=20
  200.         call cgetrs(attr,string,maxlen,ierr)
  201.         if(ierr.eq.-1)return
  202.  
  203.         Description:
  204.  
  205.           This routine gets an floating point string from the user. It can
  206.         be no longer than maxlen, and the actual length typed is returned in
  207.         maxlen. Ierr is returned as zero if all went well. If the user
  208.         types the ESC key during string input the string is cleared and
  209.         the function returns ierr=-1. This allows a clean cancel
  210.         of the read function. The string characters are echoed as they
  211.         are typed, but with normal video attributes. This function uses
  212.         the BIOS keyboard functions, and cannot be interrupted by the
  213.         Ctrl-C or Ctrl-Break keypresses. Only integers and the -,+ signs
  214.         and D,d,E,e are accepted by this routine. This routine clears the
  215.         string prior to accepting any input.
  216.            The returned string is not null terminated and may be read into
  217.         an integer variable as follows:
  218.  
  219.         real*8    R1
  220.         real*4    R2
  221.         character string*20
  222.  
  223.         maxlen=20
  224.         call cput(' Enter a number: `')
  225.         call cgetrs(attr,string,maxlen,ierr)
  226.         if(ierr.eq.-1)return
  227.         Read(unit=string,fmt='(g20.0)')R1
  228.  
  229.         maxlen=20
  230.         call cput(' Enter a number: `')
  231.         call cgetrs(attr,string,maxlen,ierr)
  232.         if(ierr.eq.-1)return
  233.         Read(unit=string,fmt='(g20.0)')R2
  234.  
  235.         INPUTS:
  236.         ATTR   = Attribute to use in echoing the string to the screen.
  237.         Maxle